package com.zlsy.thread.uncaughtexception;

/**
 * @author zhouliang
 * @date 2020/03/15
 **/
public class UseOwnUncaughtExceptionHandler implements Runnable {

    public static void main(String[] args) {
        Thread.setDefaultUncaughtExceptionHandler(new MyUncaughtExceptionHandler("捕获器1"));
        Thread thread = new Thread(new UseOwnUncaughtExceptionHandler());
        thread.start();
    }

    @Override
    public void run() {
        throw new RuntimeException("抛异常了！");
    }
}
